//
//(C) Copyright 2011 HongKong Airline.,Ltd. 
//
/**
 * messageServiceImpl
 * 项目名称:代购系统
 *
 * @author Mengxiangliang
 *
 * 功能描述:
 * 
 * 历史版本:2013-01-04 v1.0.0 Mengxiangliang  创建:
 * 
 */
 
package com.gamutsoft.amb.message.service.impl;

import java.util.List;
import java.util.Map;

import com.gamutsoft.amb.common.bean.QueryExample;
import com.gamutsoft.amb.common.exception.BusinessException;
import com.gamutsoft.amb.common.service.impl.GenericServiceImpl;
import com.gamutsoft.amb.message.dao.IMessageDao;
import com.gamutsoft.amb.message.model.Message;
import com.gamutsoft.amb.message.service.IMessageService;
import com.gamutsoft.amb.messageuser.model.MessageUser;

public class MessageServiceImpl extends GenericServiceImpl<Message, Long> implements IMessageService {
	public IMessageDao messageDao;

    public MessageServiceImpl(IMessageDao messageDao) {
		super(messageDao);
		this.messageDao = messageDao;
	}
	
	/**
	 * 根据条件查询记录
	 * @author Mengxiangliang
	 * @param  QueryExample
	 * @return MessageList
	 * @throws BusinessException
	 */
	public List<Map> searchMessageList(QueryExample qe) throws BusinessException{
	  
	   return messageDao.searchMessageList(qe);
	   
	}
	
	/**
	 * 根据ID查询记录
	 * @author Mengxiangliang
	 * @param Long id
	 * @return domain
	 * @throws BusinessException
	 */
	public Message searchMessageById(Long id) throws BusinessException{
	  
	   return messageDao.searchMessageById(id);
	   
	}

	/**
	 *  删除记录
	 * @author Mengxiangliang	 
	 * @param id
	 * @throws BusinessException
	 */
	public void deleteMessageById(Long id) throws BusinessException{
	 
	  messageDao.deleteMessageById(id);
	  
	}
	
	/**
	 * 修改记录
	 * @author Mengxiangliang
	 * @param domain
	 * @throws BusinessException
	 */
	public void updateMessage(Message domain) throws BusinessException{
	
	   messageDao.save(domain);
	   
	}

	/**
	 * 新增记录
	 * @author Mengxiangliang
	 * @param domain
	 * @return
	 * @throws BusinessException
	 */
	public void createMessage(Message domain) throws BusinessException{
	
	   messageDao.save(domain);
	}

	@Override
	public List<Map> searchMessageByWhere(QueryExample qe, MessageUser domain)
			throws BusinessException {
		// TODO Auto-generated method stub
		return messageDao.searchMessageByWhere(qe, domain);
	}
	

}